<template>
	<view class="container">
		<!-- 背景图区域 -->
		<view class="banner">
			<image src="../../static/images/banner/banner.jpg" class="bg"></image>
			<view class="intro">
				<view class="greet">您好,{{ isLogin ? userInfo.nickname : '游客'}}</view>
				<view class="note">一杯奶茶,一口软欧包,在奈雪遇见两种美好</view>
			</view>
		</view>
		<!-- 内容区域 -->
		<view class="content">
			<!-- 点餐入口 -->
			<view class="entrance">
				<view class="item" @top="takein">
					<image src="../../static/images/index/zq.png" class="icon"></image>
					<view class="title">自取</view>
				</view>
				<view class="item" @tap="takeout">
					<image src="../../static/images/index/wm.png" class="icon"></image>
					<view class="title">外卖</view>
				</view>
			</view>
			<!-- 会员积分 -->
			<view class="info">
				<!-- 积分详情 -->
				<view class="integral-section">
					<view class="top">
						<text class="title">我的积分</text>
						<text class="value"></text>
					</view>
					<view class="bottom">
						进入积分商城兑换奈雪券及周边好礼
						<view class="iconfont iconarrow-right"></view>
					</view>
				</view>
				<!-- 会员码 -->
				<view class="qrcode-section">
					<image src="../../static/images/index/qrcode.png" class="qrcode"></image>
					<text>会员码</text>
				</view>
			</view>
			<!-- 茶礼包 -->
			<view class="navigators">
				<view class="left">
					<view class="grid flex-column just-content-center">
						<view class="d-flex align-items-center">
							<image src="../../static/images/index/csc.png" class="mark-img"></image>
							<view class="font-size-sm text-color-base">奈雪的茶商城</view>
						</view>
						<view class="text-color-assist" style="margin-left: 40rpx;font-size: 20rpx;">优质茶礼盒,网红零食</view>
					</view>
					<view class="grid justify-content-end align-items-end">
						<image src="../../static/images/index/yzclh.png" class="yzclh-img"></image>
					</view>
				</view>
				<view class="right">
					<view class="tea-activity">
						<image src="../../static/images/index/mcsb.png" class="mark-img"></image>
						<view >买茶送包</view>
						<view class="right-img">
							<image src="../../static/images/index/mcsb_bg.png" mode="widthFix"></image>
						</view>
					</view>
					<view class="member-gifts">
						<image src="../../static/images/index/hyjb.png" class="mark-img"></image>
						<view >会员券包</view>
						<view class="right-img">
							<image src="../../static/images/index/hyjb_bg.png" mode="widthFix"></image>
						</view>
					</view>
				</view>
			</view>
			<!-- 会员新鲜事 -->
			<view class="">
				
			</view>
		</view>
	</view>
</template>

<script>
	import {mapState} from 'vuex'
	export default {
		data() {
			return {
				
			}
		},
		computed:{
			...mapState(['isLogin'])
		},
		onLoad() {

		},
		methods: {
			// 自取函数
			takein(){

			},
			// 外卖函数
			takeout(){
				if(!this.isLogin){
					uni.navigateTo({
						url: "../login/login"
					})
				}
			},
		}
	}
</script>

<style lang="scss" scoped>
	.container{
		.banner{
			position: relative;
			width: 100%;
			height: 600rpx;
			// 背景图
			.bg{
				width: 100%;
				height: 600rpx;
			}
			.intro{
				position: absolute;
				display: flex;
				flex-direction: column;
				color: #FFFFFF;
				top: calc(50rpx + var(--status-bar-height));
				left: 40rpx;
				.greet{
					font-size: $font-size-lg;
					margin-bottom: 10rpx;
				}
				.note{
					font-size: $font-size-sm;
				}
			}
		}
		
		.content{
			padding: 0 30rpx;
			// 点餐入口
			.entrance{
				position: relative;
				padding: 30rpx 0;
				margin-top: -80rpx;
				margin-bottom: 30rpx;
				border-radius: 10rpx;
				background-color: #FFFFFF;
				box-shadow: $box-shadow;
				display: flex;
				align-items: center;
				justify-content: center;
				.item{
					position: relative;
					display: flex;
					flex: 1;
					flex-direction: column;
					align-items: center;
					justify-content: center;
					&:nth-child(1):after{
						content: "";
						position: absolute;
						right: 0;
						width: 1rpx;
						height: 100rpx;
						background-color: $text-color-assist;
						transform: scale(0.5,0.8);
					}
					.icon{
						width: 84rpx;
						height: 84rpx;
						margin: 20rpx;
					}
					.title{
						font-size: 30rpx;
						font-weight: 600;
						color: $text-color-base;
					}
				}
			}
			// 会员积分
			.info{
				position: relative;
				background-color: #FFFFFF;
				margin-bottom: 30rpx;
				padding: 30rpx;
				display: flex;
				align-items: center;
				justify-content: center;
				border-radius: $border-radius-base;
				box-shadow: $box-shadow;
				/* 会员积分 */
				.integral-section{
					flex: 1;
					display: flex;
					flex-direction: column;
					justify-content: center;
					.top{
						display: flex;
						align-items: center;
						border: 1rpx solid red;
						.title{
							color: $text-color-base;
							font-size: $font-size-base;
							margin-right: -80rpx;
						}
						.value{
							font-size: 40rpx;
							font-weight: bold;
						}
					}
					.bottom{
						color: $text-color-assist;
						font-size: $font-size-sm;
						display: flex;
						align-items: center;
						border: 1rpx solid green;
					}
				}
				// 会员码
				.qrcode-section{
					display: flex;
					flex-direction: column;
					justify-content: center;
					align-items: center;
					font-size: $font-size-sm;
					color: $color-primary;
					.qrcode{
						width: 40rpx;
						height: 40rpx;
						margin-bottom: 12rpx;
					}
				}
			}
			// 茶礼包
			.navigators{
				width: 100%;
				margin-bottom: 20rpx;
				padding: 20rpx;
				display: flex;
				align-items: stretch;
				border-radius: 10rpx;
				background-color: #FFFFFF;
				box-shadow: $box-shadow;
				.left{
					width: 340rpx;
					margin-right: 20rpx;
					padding: 0 20rpx;
					display: flex;
					flex-direction: column;
					font-size: $font-size-sm;
					color: $text-color-base;
					background-color: #F2F2E6;
					.grid{
						display: flex;
						height: 50%;
						.mark-img{
							width: 30rpx;
							height: 30rpx;
							margin-right: 10rpx;
						}
						.yzclh-img{
							width: 214.86rpx;
							height: 122.96rpx;
							// margin-top: 10rpx;
						}
					}
				}
				.right{
					width: 290rpx;
					display: flex;
					flex-direction: column;
					.tea-activity,
					.member-gifts{
						position: relative;
						display: flex;
						align-items: center;
						width: 100%;
						padding: 20rpx;
						font-size: $font-size-sm;
						color: $text-color-base;
					}
					.tea-activity{
						margin-bottom: 20rpx;
						background-color: #FDF3F2;
					}
					.member-gifts{
						margin-bottom: 20rpx;
						background-color: #FCF6D4;
					}
					.right-img{
						flex: 1;
						display: flex;
						align-items: flex-end;
						position: relative;
						margin-left: 20rpx;
						margin-right: -20rpx;
						margin-bottom: -20rpx;
						image{
							width: 100%;
						}
					}
				}
			}
			// 会员新鲜事
		}
	}	
</style>
